package cn.yusei.teamTribe.dao.post;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.yusei.teamTribe.dao.post.po.PostReflectPO;

public interface PostReflecDAO {

	final String POST_USER_TEAM_TABLE = " r_post_user_team ";
	
	@Update({"update", POST_USER_TEAM_TABLE, "set user_id = #{userId}, team_id =  #{teamId} where post_id = last_insert_id()"})
	void updateReflect(PostReflectPO postReflectPO);
	
	@Select({"select user_id from", POST_USER_TEAM_TABLE, " where post_id = #{id} limit 1"})
	public Integer selectUserById(@Param("id") int id);
	
	@Select({"select team_id from", POST_USER_TEAM_TABLE, " where post_id = #{id} limit 1"})
	public Integer selectTeamById(@Param("id") int id);
}
